import normalRequest from "../supports/requests/normalRequest"
import authRequest from "../supports/requests/authRequest"

export function guestGetProducts(data) {
  let url = 'products/list'
  return normalRequest(url,{ data: data })
}

export function userGetProductsSearch(data) {
  let url = 'products/search'
  return normalRequest(url,{ data: data })
}

export function userGetProducts(data, categoryId) {
  let url = 'products/list/'
  if (categoryId) {
    url += categoryId
  }
  return authRequest(url, { data: data })
}

export function getProduct(id, data) {
  return normalRequest('products/' + id, { data: data })
}

export function drinkGetProducts(data) {
  return normalRequest('drink/products', { data: data })
}

export function getProductInvitePoster(productId) {
  return authRequest('invites/poster/' + productId)
}

/** ====================================================================================================================*/

export function getHotProducts(data) {
  return normalRequest('hot/products', { data: data })
}

export function getProductsList(data) {
  return normalRequest('products/list', { data: data })
}

export function getTopProduct(data) {
  return normalRequest('products/list', { data: data })
}